<?php

sql_query ("UPDATE news SET hide_news=1 WHERE hide_news=0 AND end_date_news < CURRENT_DATE()") or die(mysql_error());
sql_query ("UPDATE news_prep SET 	hide_news_prep=1 WHERE hide_news_prep=0 AND end_date_news_prep < CURRENT_DATE()") or die(mysql_error());

$newnews = sql_query ("select * from news_prep  WHERE hide_news_prep=0 order by id_news_prep desc limit $prepnewsmain") or die(mysql_error());
if (mysql_num_rows($newnews)!=0) {
echo '<table class="mainnewsl">';
while ($rownewnews = mysql_fetch_array($newnews)) 
{
	$loginpr=$rownewnews['login'];
	$prlogm=sql_query ("select predmet,fam,name from user where login='$loginpr'") or die(mysql_error());
	$prlog = mysql_fetch_array($prlogm);
	echo '<tr class="big"><td class="mainnewsz"><strong>Новость от преподователя по "',$prlog['predmet'].'" '.$prlog['fam'].' '.$prlog['name'].' ('.$loginpr.'):</strong></td></tr>';
echo '<tr><td><div class="prnews">'.$rownewnews['text_news_prep'].'</div><br />C ',parse_date($rownewnews['date_news_prep']);

if ($rownewnews['end_date_news_prep']!='9999-12-31') {
echo ' по '.parse_date($rownewnews['end_date_news_prep']);} 
echo '<br /><div class="date">'.$rownewnews['login_prep'].'</div></td></tr>';
}

echo '</table>';}
?>


<?php
echo '
<div id="slideshow">
<div id="slideshowHolder">
 <img src="/images/main/vgtu_sm.jpg" alt="ВГТУ главный корпус" />
 <a href="/images/main/vgtu.jpg"></a>
 <img src="/images/main/3k_sm.jpg" alt="ВГТУ 3 корпус" />
 <a href="/images/main/3k.jpg"></a>
  <img src="/images/main/teatr_sm.jpg" alt="Студенческий театр" />
 <a href="/images/main/teatr.jpg"></a>
 <img src="/images/main/gerb_sm.jpg" alt="Герб Естественно-технического колледжа" />
 <a href="/images/main/gerb.jpg"></a>
  <img src="/images/main/ped_sm.jpg" alt="Педагогический состав" />
 <a href="/images/main/ped.jpg"></a>
  <img src="/images/main/director_sm.jpg" alt="Директора Естественно-технического колледжа" />
 <a href="/images/main/director.jpg"></a>
  <img src="/images/main/conf_sm.jpg" alt="Студенческая конференция" />
 <a href="/images/main/conf.jpg"></a>
</div>
<br />
<script>
$("#slideshowHolder").jqFancyTransitions({ width: 400, height: 300, navigation: true, links : true });
$("#slideshowHolder a").lightBox({fixedNavigation:true});
</script>
</div>';
$mains=sql_query ("select * FROM `page` WHERE address='main'");
$main=mysql_fetch_array($mains);
echo $main['text'];
?>